package com.lanchetech.dao;
import org.apache.ibatis.annotations.Param;

import com.lanchetech.bean.request.PageReq;
import com.lanchetech.bean.request.UserVoucherReq;
import com.lanchetech.bean.vo.UserVoucherVO;
import com.lanchetech.entity.UserVoucher;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface UserVoucherMapper {
    int deleteByPrimaryKey(Long id);

    int insert(UserVoucher record);

    int insertSelective(UserVoucher record);

    UserVoucher selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(UserVoucher record);

    int updateByPrimaryKey(UserVoucher record);

    List<UserVoucherVO> findAllPage(UserVoucherReq req);

    Long countByUserIdAndStatus(@Param("userId")Long userId,@Param("status")Byte status);

    UserVoucher findOneByUserIdAndSpuIdAndStatus(@Param("userId")Long userId,@Param("spuId")Long spuId,@Param("status")Byte status);

    int updateStatusByUseOrderSkuId(@Param("updatedStatus")Byte updatedStatus,@Param("useOrderSkuId")Long useOrderSkuId);




}